#include "ThreadPool.hpp"
#include "Task.hpp"

using namespace LogModule;
using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG_STRATEGY();

    sleep(1);

    //ThreadPool<task_t> *tp = new ThreadPool<task_t>();
    ThreadPool<task_t>::GetInstance()->Start();

    sleep(1);
    for(int i = 0; i < 10; i++)
    {
        ThreadPool<task_t>::GetInstance()->Enqueue(DownLoad);
        sleep(1);
    }

    sleep(3);

    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Join();

    // std::unique_ptr<LogStrategy> strategy = std::make_unique<ConsoleLogStrategy>();
    // std::unique_ptr<LogStrategy> strategy = std::make_unique<FileLogStrategy>();
    // strategy->syncLog("hello");

    //logger(LogLevel::DEBUG, "main.cc" ,10) << "hello world" << " haha" << 3.14;

    //ENABLE_FILE_LOG_STRATEGY();

    // LOG(LogLevel::DEBUG) << "hello world" << " haha" << 3.14;
    // LOG(LogLevel::DEBUG) << "hello world" << " haha" << 3.14;
    // LOG(LogLevel::DEBUG) << "hello world" << " haha" << 3.14;
    // LOG(LogLevel::DEBUG) << "hello world" << " haha" << 3.14;

    sleep(1);

    return 0;
}